<template>
	<div>
		<!-- 		<List header="抽成规则"  border>
		    <ListItem>
		        <ListItemMeta title="店长抽成比例" />
				<template #action>
				    <li>
				        <div>10%</div>
						<a href="">Edit</a>
				    </li>
				</template>
		    </ListItem>
		    <ListItem>
		        <ListItemMeta title="教练抽成比例" />
		    	<template #action>
		    	    <li>
		    	        <div>10%</div>
		    			<a href="">Edit</a>
		    	    </li>
		    	</template>
		    </ListItem>
		</List> -->
		<form @submit.prevent>
			<List header="提款规则" border>
				<ListItem>
					<ListItemMeta title="店长提款抽成比例" />
					<template #action>
						<li>
							<!-- <div >{{setting.dper}}</div> -->
							<Input v-model="setting.dper" placeholder="请输入店长提款抽成比例" />
						</li>
					</template>
				</ListItem>
				<ListItem>
					<ListItemMeta title="教练提款抽成比例" />
					<template #action>
						<li>
							<!-- 		    	        <div >{{setting.jper}}</div>
		    			<a href="">Edit</a> -->
							<Input v-model="setting.jper" placeholder="请输入教练提款抽成比例" />
						</li>
					</template>
				</ListItem>
			</List>


			<List border>
				<ListItem>
					<ListItemMeta title="分账周期循环次数" />
					<template #action>
						<li>
				  	<!-- <div v-model="setting.fxloop">{{setting.fxloop}}</div>
						<a href="">Edit</a> -->
							<Input v-model="setting.fxloop" placeholder="请输入分账周期循环次数" />
						</li>
					</template>
				</ListItem>
			</List>
			
			<List border>
				<ListItem>
					<ListItemMeta title="教练保证金" />
					<template #action>
						<li>
				  	<!-- <div v-model="setting.fxloop">{{setting.fxloop}}</div>
						<a href="">Edit</a> -->
							<Input v-model="setting.jlyj" placeholder="请输入教练保证金" />
						</li>
					</template>
				</ListItem>
			</List>
			
			<List border>
				<ListItem>
					<ListItemMeta title="店长保证金" />
					<template #action>
						<li>
				  	<!-- <div v-model="setting.fxloop">{{setting.fxloop}}</div>
						<a href="">Edit</a> -->
							<Input v-model="setting.dzyj" placeholder="请输入店长保证金" />
						</li>
					</template>
				</ListItem>
			</List>
			
			<List border>
				<ListItem>
					<ListItemMeta title="学员保证金" />
					<template #action>
						<li>
				  	<!-- <div v-model="setting.fxloop">{{setting.fxloop}}</div>
						<a href="">Edit</a> -->
							<Input v-model="setting.xyyj" placeholder="请输入学员保证金" />
						</li>
					</template>
				</ListItem>
			</List>
			<div class="button-container right">
				<Button @click="savePtgl">保存</Button>
			</div>
		</form>
	</div>
</template>
<script>
	export default {
		data() {
			return {
				setting: {
					jper: null,
					dper: null,
					fxloop: null,
					dzyj: null,
					jlyj: null,
					xyyj: null
				}
			}
		},
		methods: {
			savePtgl() {
				this.http.post({
					url: "/settings/xtsz/info",
					data: this.setting,
				}).then(response => {
					if (response.saveMsg) {
						this.message.info("保存成功");
					}
				});
			}
		},
		created: function() {
			this.http.get({
				url: "/settings/xtsz",
			}).then(data => {
				this.setting = data.xtsz;
			});
		}
	}
</script>
